import { PaginationParams, PaginationResponse } from '@/lib/pagination';
import request from '@/utils/request';
import type { CreateUserRequest, UpdateUserRequest, User } from '@/types/user';

// 获取用户列表
export const getUserList = (params: PaginationParams) => {
  return request.post<PaginationResponse<User>>('/api/admin/users/page', params);
};

// 创建用户
export const createUser = (data: Partial<User>) => {
  return request.post('/api/admin/users/create', data);
};

// 更新用户
export const updateUser = (data: Partial<User>) => {
  return request.post('/api/admin/users/update', data);
};

// 删除用户
export const deleteUser = (data: { id: string }) => {
  return request.post('/api/admin/users/delete', data);
};